<%@ page pageEncoding="UTF-8"%>
<c:import url="../../../template/layout.jsp" charEncoding="UTF-8">
    <c:param name="title" value="新建角色" />
    <c:param name="body">
        <script>
            $(document).ready(
                    function() {
                        var id = $(".id").val();
                        if(id){

                        }

                    });
        </script>


        <div class="content-title">新建角色</div>

        <form name="role" class="form-horizontal"  action="${pageContext.request.contextPath}/system/role/edit" method="post">
            <div align="left" style="width: 600px; margin-right: auto; margin-left: auto;">
                <div class="form-group">
                    <label for="rolename" class="col-sm-2 control-label"><span style="color:red;">*</span>角色名</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" name="rolename" required>
                    </div>
                </div>
                <div class="form-group">
                    <label for="description" class="col-sm-2 control-label"><span style="color:red;">*</span>角色描述</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" name="role_description" required>
                    </div>
                </div>

                <div class="form-group">
                    <label for="permission" class="col-sm-2 control-label"><span style="color:red;">*</span>分配权限</label>
                    <div class="col-sm-10">
                        <c:if test="${permissions != null}">
                            <c:forEach items="${permissions}" var="permission">
                                <label><input type="checkbox" name="permission" value="${permission.id}">${permission.per_description}</label></br>
                            </c:forEach>
                        </c:if>
                    </div>
                </div>

                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                        <input type="submit" value="提交" class="btn btn-primary" /> <input type="reset" value="重置"
                                                                                          class="btn btn-default" />
                    </div>
                </div>
            </div>
        </form>
    </c:param>
</c:import>
